import webpack from "webpack";
import { merge } from "webpack-merge";
import baseConfig from "./webpack.base.js";
import "webpack-dev-server";

console.log("----------------------devConfig--------------------------------");
const devConfig = merge(baseConfig, {
  mode: "development",
  devtool: "inline-source-map",
  devServer: {
    // hot: true,
    open: false,
    proxy: {
      "/year": {
        target: "https://ichangan.changan.com.cn/mas/v5/app/restful/otr_rest/",
        changeOrigin: true,
        pathRewrite: { "^/year": "" },
      },
    },
  },
  plugins: [new webpack.HotModuleReplacementPlugin()],
});

export default devConfig;
